<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" %>
<%@ page language="java" import="java.util.*" %>
<%@ page language="java" import="com.tangdi.production.mpapp.utils.WebPayServletUtil" %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	request.setAttribute("on_back", "1");

	WebPayServletUtil payUtil = new WebPayServletUtil();

	boolean ok = payUtil.validation(request, response);
	if (!ok) {
		payUtil.toLoginPage(request, response);
	}

	request.setAttribute("title", "实名认证");
%>
<!DOCTYPE html>
<html lang="zh">
<base href="<%=basePath%>">
<head>
<title>实名认证</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta charset="utf-8" />
<meta name="description" content="Common form elements and layouts" />
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

<script type="text/javascript" src="js/jquery-1.7.1.min.js"
	charset="UTF-8"></script>
<script type="text/javascript" src="js/jquery.base64.js"
		charset="UTF-8"></script>
<script type="text/javascript" src="js/core-1.0.js" charset="UTF-8"></script>
<script type="text/javascript" src="js/webpay/base.js" charset="UTF-8"></script>
<!-- bootstrap & fontawesome -->
<link rel="stylesheet" href="ace_v1.3/assets/css/bootstrap.css" />

<link rel="stylesheet" href="ace_v1.3/assets/css/chosen.css" />
<link rel="stylesheet" href="ace_v1.3/assets/css/font-awesome.css" />

<!-- text fonts -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace-fonts.css" />

<!-- ace styles -->
<link rel="stylesheet" href="ace_v1.3/assets/css/ace.css"
	class="ace-main-stylesheet" id="main-ace-style" />


<link rel="stylesheet" href="css/webpay/user_certification.css" />

<link rel="stylesheet" href="css/core.css" />

<!--[if lte IE 9]>
			<link rel="stylesheet" href="ace_v1.3/assets/css/ace-part2.css" class="ace-main-stylesheet" />
		<![endif]-->

<!--[if lte IE 9]>
		  <link rel="stylesheet" href="ace_v1.3/assets/css/ace-ie.css" />
		<![endif]-->



<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

<!--[if lte IE 8]>
		<script src="ace_v1.3/assets/js/html5shiv.js"></script>
		<script src="ace_v1.3/assets/js/respond.js"></script>
		<![endif]-->
<jsp:include page="../plug/head-include.jsp" />
<style type="text/css">
</style>
<script type="text/javascript">
	function certficationSubmit(from){
		var $btn = $("button[type='submit']");
		doBtn($btn,0)
		var $cardHandheld = $("input[name='cardHandheld']");
		if(!$cardHandheld.val()){
			alert("请上传手持身份证照片");
			doBtn($btn,1);
			return false;
		}
		var $CERT_FRONT = $("input[name='cardFront']");
		if(!$CERT_FRONT.val()){
			alert("请上传身份证正面照");
			doBtn($btn,1);
			return false;
		}
		var $BANK_FRONT = $("input[name='cardBack']");
		if(!$BANK_FRONT.val()){
			alert("请拍上传身份证背面照");
			doBtn($btn,1);
			return false;
		}
		/* var BANKCARDNO = $("input[name='BANKCARDNO']").val();
		var BANKCARDNO2 = $("input[name='BANKCARDNO_2']").val();
		if(!(BANKCARDNO === BANKCARDNO2)){
			alert("两次输入的卡号不一致");
			doBtn($btn,1);
			return false;
		} */
		
		if(!TDValidateForm($(from))){
			doBtn($btn,1);
			return false;
		}
		validateCallback($(from),certificationSuccess);
		return false;
	}
	
	function certificationSuccess(json) {
		if (codeSuccess(json)) {
			alert(json["RSPMSG"]);
			openUrl(BASE_PATH + "user/user_center.jsp");
		} else {
			alert(json["RSPMSG"]);
			doBtn($("button[type='submit']"),1);
		}
	}
</script>
</head>
<body class="no-skin">
	<!-- #section:basics/navbar.layout -->
	<jsp:include page="../plug/title.jsp" />

	<!-- /section:basics/navbar.layout -->
	<div class="main-container" id="main-container">

		<!-- #section:basics/sidebar -->
		<!-- /section:basics/sidebar -->
		<div class="main-content">
			<div class="main-content-inner">
				<!-- #section:basics/content.breadcrumbs -->
				<!-- /section:basics/content.breadcrumbs -->
				<div class="page-content">
					<!-- #section:settings.box -->
					<!-- <div class="page-header">
						<h1>
							Form Elements <small> <i
								class="ace-icon fa fa-angle-double-right"></i> Common form
								elements and layouts
							</small>
						</h1>
					</div>
					 -->
					 <div id="show" style="text-align: right;display: none;">
					 	<a href="javascript:void(0)" onclick="openToBrowser('1')">《无法拍照上传?》</a>
					 </div>
					<div class="row">
						<div class="col-xs-12">
							<!-- PAGE CONTENT BEGINS -->
							<form class="form-horizontal" method="post"
								action="SY0007.web" role="form"
								mask="true"
								onsubmit="return certficationSubmit(this)">
								
								<input type="hidden" name="certificateType" value="01"/>

								<div class="row photograph-box">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2 align-center">
										<div style="">
											<input type="file" id="file_cardHandheld" accept="image/*" capture="camera" style="display: none;"/>
											<input type="hidden" name="cardHandheld" ref="file"/>
											<div class="photograph is-click" tp="101">+</div>
											<div class="text ">手持身份证照片</div>
										</div>
									</div>
									<div class="col-sm-6 col-xs-6 align-center">
										<div style="float: right;">
											<input type="file" id="file_cardFront" accept="image/*" capture="camera" style="display: none;"/>
											<input type="hidden" name="cardFront" ref="file"/>
											<div class="photograph is-click" tp="102">+</div>
											<div class="text ">身份证正面照片</div>
										</div>
									</div>
									<div class="col-sm-6 col-xs-6 align-center">
										<div style="float: left;">
											<input type="file" id="file_" accept="image/*" capture="camera"  style="display: none;" />
											<input type="hidden" name="cardBack" ref="file"/>
											<div class="photograph is-click" tp="103">+</div>
											<div class="text">身份证正背面照片</div>
										</div>
									</div>
								</div>
								<!-- 
								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<input type="text" name="USERNAME" validate="true"
											placeholder="真实姓名" class="form-control" />
									</div>
								</div>
-->
								<!-- <div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<input type="text" name="BANKCARDNO" validate="true"
											placeholder="请输入收款结算卡号" class="form-control" />
									</div>
								</div>
								
								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<input type="text" validate="true" name="BANKCARDNO_2"
											placeholder="请确认收款结算卡号" class="form-control" />
									</div>
								</div> -->

								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<input type="text" name="custName" validate="true"
											placeholder="请输入本人姓名" class="form-control" />
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-8 col-xs-12 col-sm-offset-2">
										<input type="text" name="certificateNo" validate="true"
											placeholder="请输入本人身份证号码" class="form-control" />
									</div>
								</div>


								<div class="row">
									<div
										class="clearfix menu-btn-box col-sm-8 col-xs-12 col-sm-offset-2">

										<div class="col-sm-6 col-xs-6">
											<button class="btn btn-info btn-block" type="button"
												onclick="toIndexPage()">稍后认证</button>
										</div>

										<div class="col-sm-6 col-xs-6">
											<button class="btn btn-info  btn-block" type="submit"
												>上传认证</button>
										</div>

									</div>
								</div>
							</form>
							<!-- /.col -->
						</div>
						<!-- /.row -->
					</div>
					
					<div class="row" id="debug">
					
					</div>

					<!-- /.page-header -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<!-- /.main-content -->

		<!-- /.main-container -->
	</div>
	<script type="text/javascript"
		src="ace_v1.3/assets/js/jquery.maskedinput.js" charset="UTF-8"></script>
	<script type="text/javascript" src="js/jquery.tips.js" charset="UTF-8"></script>
	<!-- <script type="text/javascript" src="js/LocalResizeIMG.js"></script>
	<script type="text/javascript" src="js/mobileBUGFix.mini.js"></script> -->
	<script type="text/javascript" src="js/lrz/mobileFix.mini.js"></script>
	<script type="text/javascript" src="js/lrz/exif.js"></script>
	<script type="text/javascript" src="js/lrz/lrz.js"></script>
	
	<script type="text/javascript" src="js/user/user_certification.js"
		charset="UTF-8"></script>
	<!-- basic scripts -->
</body>
</html>